<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"
    import="java.util.*,com.bean.*,com.utils.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet"
	href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
<script
	src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script
	src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<%
	//查找目前正在进行的考试
	List<Exam> list=DaoFactory.getExamDaoInstance().allexamsearch();
	String  examname=null;
	for(Exam exam:list)
	{
		if(exam.getE_isstart())
			examname=exam.getE_name();
	}
	//查看该考试的学生登录，提交情况
	List<Student> list2=DaoFactory.getStudentDaoInstance().allstudentsearch();
	int all_number=0;
	int login_number=0;
	int submit_number=0;
	for(Student s:list2)
	{
		if(s.getStu_exam().equals(examname))
		{
			all_number++;
			if(s.getStu_ip()!=null)
			{
				login_number++;
			}
			if(s.getStu_submit()!=null&&!s.getStu_submit().equals("null"))
			{
				submit_number++;
			}
		}
			
	}
	int null_login=all_number-login_number;
	int null_submit=all_number-submit_number;
%>
<jsp:include page="teacher_head.jsp"></jsp:include>
<div class="container">
	<div class="panel panel-info">
	<div class="panel-heading">
		<h3 class="panel-title">
			<span class="glyphicon glyphicon-th-list"></span><font color='red'><%=examname%></font>进行情况
        </h3>
    </div>
    <div class="panel-body">
        <table class="table table-bordered">
            <tr>
                <th>参加人数</th>
                <th>登陆人数</th>
                <th>未登录人数</th>
                <th>已提交</th>
                <th>未提交</th>
              </tr>
              <tr>
                <th><%=all_number %></th>
                <th><%=login_number %></th>
                <th><%=null_login %></th>
                <th><%=submit_number %></th>
                <th><%=null_submit %></th>
              </tr>
        </table>
    </div>
    </div>
</div>
</body>
</html>